import argparse
import json
from Fuzzer import BaseFuzzer,MessageFuzzer,MasterFuzzer
from TLSMapper.TLSSUT import *
from TLSMapper.TLSProtocol import *

ciphersuites=[0x1301,0x1302,0x1303,0x00ff]


def main():
    # 创建参数解析器
    parser = argparse.ArgumentParser(description='Run the fuzzer with specified configuration')
    parser.add_argument('config', help='Path to the configuration JSON file')
    parser.add_argument('--test-seeds', action='store_true', help='Test seeds before fuzzing')
    
    # 解析参数
    args = parser.parse_args()





    fuzzer = MasterFuzzer(args.config)

    # config = './configs/openssl_with_master.json'

    # fuzzer = MasterFuzzer(config)
    
    fuzzer.fuzz(test_seeds=args.test_seeds)
    fuzzer.clear()
    # fuzzer.run_target_with_symbol(alphabet1,5000)

    # # 执行fuzzing流程
    # fuzzer.perform_dry_run()
    # fuzzer.fuzz()
    # fuzzer.clear()
    
    print("Fuzzing completed successfully.")



# python3 main2.py ./configs/openssl.json
if __name__ == "__main__":
    main()


    